package cn.edu.neusoft.maxingxin231.yuejian06.Adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import java.util.List;

import cn.edu.neusoft.maxingxin231.yuejian06.Bean.ClubBean;
import cn.edu.neusoft.maxingxin231.yuejian06.Bean.CoachBean;
import cn.edu.neusoft.maxingxin231.yuejian06.Bean.PostBean;
import cn.edu.neusoft.maxingxin231.yuejian06.Bean.PostCommentBean;
import cn.edu.neusoft.maxingxin231.yuejian06.Bean.TrainBean;
import cn.edu.neusoft.maxingxin231.yuejian06.Listener.ListListener;
import cn.edu.neusoft.maxingxin231.yuejian06.R;

public class CoachAdapter extends Base3Adapter<CoachBean> {
    String id,coach_name,att_num,coach_img;

    public CoachAdapter(Context context, List<CoachBean> items, int layoutResource) {
        super(context, items, layoutResource);
    }

    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder,final int position) {
        CoachBean coachBean = items.get(position);
        if (coachBean == null)return;
        ClubTabViewHolder clubTabViewHolder = (ClubTabViewHolder)holder;
        clubTabViewHolder.co_2.setText(coachBean.getCoach_name());
        clubTabViewHolder.co_3.setText(coachBean.getAtt_num());
        id = coachBean.getCoach_id();
        coach_name = coachBean.getCoach_name();
        att_num = coachBean.getAtt_num();
        Picasso.with(context).load("http://10.0.2.2:80/yuejian14/public/static/coach/"+items.get(position).getCoach_img()).into(clubTabViewHolder.co_1);
    }

    public void setList(List<CoachBean> list){
        this.items = list;
        notifyDataSetChanged();
    }
}
